﻿using System;

namespace Hrunga.PVCM.Framework.EventArguments
{
    /// <summary>
    /// Generic EventArguments class to be used when the value of a property
    /// of an object changes
    /// </summary>
    /// <typeparam name="T">The type of the property that has changed</typeparam>
    public class PropertyChangedEventArgs<T> : EventArgs
    {
        private readonly T oldValue;
        private readonly T newValue;

        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyChangedEventArgs&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="oldValue">The old value.</param>
        /// <param name="newValue">The new value.</param>
        public PropertyChangedEventArgs(T oldValue, T newValue)
        {
            this.oldValue = oldValue;
            this.newValue = newValue;
        }

        /// <summary>
        /// Gets the old value.
        /// </summary>
        /// <value>The old value.</value>
        public T OldValue
        {
            get { return this.oldValue; }
        }

        /// <summary>
        /// Gets the new value.
        /// </summary>
        /// <value>The new value.</value>
        public T NewValue
        {
            get { return this.newValue; }
        }
    }

}
